package com.tsing.spring_learn.config.life_cycle;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * InitializingBean Spring生命周期：属性注入
 * afterPropertiesSet
 */
@Component
public class MyInitializingBean implements ApplicationContextAware {


    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("MyBean loading");
    }
}
